package com.group56.model.dao;

import com.group56.model.entity.Order;
import java.io.FileNotFoundException;
import java.util.ArrayList;


import com.group56.model.entity.Order;

import java.io.FileNotFoundException;
import java.util.ArrayList;

/**
 * @Description: The data access object layer interface of the file Order.json
 *               is used to provide a method for adding, deleting, and modifying
 *               the file.
 * @author Yang Junhan
 * @version V1.0
 * @date 2021/5/29
 */

public interface OrderDAO {

    /**
     * @Description: Insert a new order record into file.
     * @param order: The order will be inserted into file.
     * @return boolean: If the operation executed successful, return true.
     *                  if the operation fails, return false.
     */
    public boolean insert(Order order);

    /**
     * @Description: Delete a order.
     * @param orderID: The orderID of the order will be delete.
     * @return boolean: If the operation executed successful, return true.
     *                  if the operation fails, return false.
     */
    public boolean delete(String orderID);

    /**
     * @Description: Update a new order record into file.
     * @param order: The new order.
     * @param orderID: The id of old order.
     * @return boolean: If the operation executed successful, return true.
     *                  if the operation fails, return false.
     */
    public boolean update(Order order, String orderID);

    /**
     * @Description: Select a order.
     * @param customerID: The orderID of order will be selected.
     * @return Order: Order selected by ID.
     */
    public ArrayList<Order> selectByCustomer(String customerID) throws FileNotFoundException;
}
